using System.Collections.Generic;
using CLELCore;

namespace CLELCore.Executable
{
	public class DataDirectory
	{
		private int _virtual_address;
		private int _size;

		public int VirtualAddress
		{
			get
			{
				return _virtual_address;
			}
			set
			{
				_virtual_address = value;
			}
		}
		public int Size
		{
			get
			{
				return _size;
			}
			set
			{
				_size = value;
			}
		}

		public long EncodedValue
		{
			get
			{
				long ret = 0;
				ret = Bits.SetHighIntOfLong(ret,_virtual_address);
				ret = Bits.SetLowIntOfLong(ret,_size);
				return ret;
			}
			set
			{
				_virtual_address = Bits.HighIntOfLong(value);
				_size = Bits.LowIntOfLong(value);
			}
		}

		public DataDirectory(int virtual_address,int size)
		{
			_virtual_address = virtual_address;
			_size = size;
		}

		public DataDirectory(long encoded)
		{
			_virtual_address = Bits.HighIntOfLong(encoded);
			_size = Bits.LowIntOfLong(encoded);
		}
	}
}
